#!/usr/bin/env perl

use utf8;
use strict;

my @people = qw< fred barney fred wilma dino barney fred pebbles>;

my %count;

$count{$_} ++ foreach @people;

my @after = values %count;

print "@after";
